{
 "cells": [
  {
   "cell_type": "code",
   "id": "initial_id",
   "metadata": {
    "collapsed": true
   },
   "source": "import numpy as np",
   "outputs": [],
   "execution_count": null
  },
  {
   "metadata": {},
   "cell_type": "code",
   "source": [
    "a=np.arange(12).reshape(3,4)\n",
    "print(a)"
   ],
   "id": "c738b22e7e7c0544",
   "outputs": [],
   "execution_count": null
  },
  {
   "metadata": {},
   "cell_type": "code",
   "source": "print(np.sum(a))",
   "id": "2eee007e66f81cee",
   "outputs": [],
   "execution_count": null
  },
  {
   "metadata": {},
   "cell_type": "code",
   "source": "print(np.sum(a,axis=0))",
   "id": "29c8c461bf54d31f",
   "outputs": [],
   "execution_count": null
  },
  {
   "metadata": {},
   "cell_type": "code",
   "source": "print(np.cumsum(a))",
   "id": "4b9c01eba2f1299b",
   "outputs": [],
   "execution_count": null
  },
  {
   "metadata": {},
   "cell_type": "code",
   "source": "print(np.cumsum(a,axis=1))",
   "id": "55faf0895304ea98",
   "outputs": [],
   "execution_count": null
  },
  {
   "metadata": {},
   "cell_type": "code",
   "source": "print(np.cumsum(a,axis=0))",
   "id": "697e2e738fd6a55",
   "outputs": [],
   "execution_count": null
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-09-21T15:49:03.765857Z",
     "start_time": "2025-09-21T15:49:03.751691Z"
    }
   },
   "cell_type": "code",
   "source": [
    "arr=np.array([[1,2,1],[2,3,4],[3,4,5]])\n",
    "print(arr)\n",
    "print(arr.shape)"
   ],
   "id": "1cea5c6a6c8820dc",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[1 2 1]\n",
      " [2 3 4]\n",
      " [3 4 5]]\n",
      "(3, 3)\n"
     ]
    }
   ],
   "execution_count": 12
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-09-21T15:49:48.967156Z",
     "start_time": "2025-09-21T15:49:48.946845Z"
    }
   },
   "cell_type": "code",
   "source": "print(np.unique(arr))",
   "id": "6869885a239cd494",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1 2 3 4 5]\n"
     ]
    }
   ],
   "execution_count": 13
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-09-21T15:50:05.320855Z",
     "start_time": "2025-09-21T15:50:05.303250Z"
    }
   },
   "cell_type": "code",
   "source": "print(arr)",
   "id": "642cb72818822ed6",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[1 2 1]\n",
      " [2 3 4]\n",
      " [3 4 5]]\n"
     ]
    }
   ],
   "execution_count": 14
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-09-21T15:51:12.822970Z",
     "start_time": "2025-09-21T15:51:12.818196Z"
    }
   },
   "cell_type": "code",
   "source": "print(np.sort(arr))",
   "id": "7e5c5b7c9afb3f56",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[1 1 2]\n",
      " [2 3 4]\n",
      " [3 4 5]]\n"
     ]
    }
   ],
   "execution_count": 15
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-09-21T15:52:44.276476Z",
     "start_time": "2025-09-21T15:52:44.259532Z"
    }
   },
   "cell_type": "code",
   "source": [
    "b=np.array([22,66,4544,3523])\n",
    "print(np.sort(b))"
   ],
   "id": "73e9ef0cf3f2e8c0",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[  22   66 3523 4544]\n"
     ]
    }
   ],
   "execution_count": 17
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-09-21T15:52:54.402328Z",
     "start_time": "2025-09-21T15:52:54.395432Z"
    }
   },
   "cell_type": "code",
   "source": "print(b)",
   "id": "4e071503b6e85c9c",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[  22   66 4544 3523]\n"
     ]
    }
   ],
   "execution_count": 18
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-09-21T15:54:17.507245Z",
     "start_time": "2025-09-21T15:54:17.489974Z"
    }
   },
   "cell_type": "code",
   "source": [
    "b.sort()\n",
    "print(b)"
   ],
   "id": "fecc5cfb24acc6f9",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[  22   66 3523 4544]\n"
     ]
    }
   ],
   "execution_count": 22
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": "",
   "id": "1f76c7f0fecbb5ce"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
